package org.itboys.product.productenum;

/**
 * Created by Administrator on 2016/5/25.
 */
public enum ProductCategoryEnum {

    PRODUCCT("普通商品", 1), HOTEL("民宿", 2), BASE("基地", 3),
    SENIC("景点", 4), FRAM_STAY("农家乐", 5);

    private int type;

    private String name;

    private ProductCategoryEnum(String name, int type) {
        this.type = type;
        this.name = name;
    }

    public static String getName(int type) {
        for (ProductCategoryEnum c : ProductCategoryEnum.values()) {
            if (type == c.type) {
                return c.name;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}